/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package service;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;

/**
 *
 * @author Thai Dac Vinh
 */
@Stateless
public class GreetingSessionBean implements GreetingSessionBeanRemote {

    @Override
    public String greeting() {
        String message;
        try {
            String host_name = InetAddress.getLocalHost().getHostName();
            message = "Hello EJB World, the host name is " + host_name;
        } catch (UnknownHostException ex) {
            message = ex.getMessage();
        }
        return message;
    }

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

}
